package com.daigou.service;

import java.math.BigDecimal;
import java.util.List;

import com.daigou.dto.OrderQuery;
import com.daigou.dto.PageInfo;
import com.daigou.dto.ServiceResult;
import com.daigou.model.Order;

 

/**  
 * @Title: OrderService.java
 * @Package com.daigou.service
 * @Description: TODO
 * @author lizhi
 * @date 2018年3月27日
 */
public interface OrderService{  
	public int deleteByPrimaryKey(Long id);

	public ServiceResult insertOrUpdate(Order order) throws Exception;
	
	public int insert(Order order);

	public int insertSelective(Order order);

	public Order selectByPrimaryKey(Long id);
	
	public PageInfo<Order> selectByCondition(OrderQuery orderQuery);
	
	/**
	 * 查询草稿状态的order
	 * @param shopId
	 * @param searchKey
	 * @return
	 */
	public List<Order> selectCaogaoByShopId(Long shopId,String searchKey);
	
	public Integer selectTotalCaogaoByShopId(Long shopId,String searchKey);
	
	public Integer selectTotalCountByCondition(OrderQuery orderQuery);
	
	public BigDecimal selectTotalAmountByCondition(OrderQuery orderQuery);
	
	public BigDecimal selectPayAmountByCondition(OrderQuery orderQuery);
	
	public BigDecimal selectNoPayAmountByCondition(OrderQuery orderQuery);
	
	public int updateByPrimaryKeySelective(Order order);

	public int updateByPrimaryKey(Order order);
	/**
	 * 更新订单那支付金额
	 * @param orderId
	 * @param payAmount
	 * @return
	 */
	public int updatePayAmountByPrimaryKey(Order order);
	/**
	 * 为首页写的订单列表
	 * 过滤所有新建和支付中的订单
	 * @param orderQuery
	 * @return
	 */
	public List<Order> selectOrder4IndexByCondition(OrderQuery orderQuery);
	/**
	 * 为报表写的订单数量
	 * @param qrderQuery
	 * @return
	 */
	public int selectOrderCount4ReportByCondition(OrderQuery qrderQuery);
	/**
	 * 为报表写的订单总额
	 * @param qrderQuery
	 * @return
	 */
	public Order selectOrder4ReportByCondition(OrderQuery qrderQuery);
}  